package com.jinlia.show.modules.base.system.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jinlia.show.common.core.entity.BaseEntity;
import com.jinlia.show.modules.base.config.DynamicSchemaConfig;
import com.jinlia.show.modules.base.constant.OrderPayStatusEnum;
import com.jinlia.show.modules.base.constant.i.IBaseEnum;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 退款单
 */
@Data
@TableName(value = "erp_order_refund", schema = DynamicSchemaConfig.schema_system)
public class OrderRefund  extends BaseEntity {
    @TableId()
    private Long id;
    /**
     * 订单id
     */
    private Long orderId;
    /**
     * 退款金额 默认 0
     */
    private BigDecimal refundMoney;
    /**
     * 退款原因
     */
    private String refundReason;
    /**
     * 已退金额 默认 0
     */
    private BigDecimal refundedMoney;

    /**
     * 收款状态
     * 收款状态10:未收，11:部分收款，12:全部收款,13部分退款，14全部退款,15退款中
     */
    private Integer refundStatus;

    @TableField(exist = false)
    private String refundStatusName;

    public void setRefundStatus(Integer refundStatus) {
        this.refundStatus = refundStatus;
        this.refundStatusName = IBaseEnum.getLabelByValue(refundStatus, OrderPayStatusEnum.class);
    }

}
